package com.atguigu.gmall.seckill.config;


import com.atguigu.gmall.common.execption.handler.GlobalExceptionController;
import com.atguigu.gmall.common.interceptor.AuthInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;



@Import(GlobalExceptionController.class)
@EnableScheduling //开启定时任务
@MapperScan(basePackages = "com.atguigu.gmall.seckill.mapper")
@EnableRabbit
@Configuration
public class SeckillConfig  implements WebMvcConfigurer {


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AuthInterceptor())
                .addPathPatterns("/api/activity/seckill/**");
    }
}
